//
// Created by jie.jiang on 2022/11/17.
//

#include "FOC_LPF.h"

LPF_DataType lpf_velocity;
void FOC_lpf_set_Parameters(){
  lpf_velocity.last_output=0;
  lpf_velocity.alpha=0.9;
}


float low_pass_filter(LPF_DataType *lpf,float input){
  float output = lpf->alpha*input+(1-lpf->alpha)*lpf->last_output;
  lpf->last_output=output;

  return output;
}